package com.chatplus.application.web.common;

import com.chatplus.application.json.Int64AsString;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.chatplus.application.common.util.FieldUtils;

import java.io.Serializable;

/**
 * @description:
 * @author: LY
 * @create: 2020-08-11 15:21
 **/
public abstract class AbstractVersionModel implements Serializable {

    private static final long serialVersionUID = -5416381807226411640L;

    @JsonSerialize(using = Int64AsString.class)
    private Long version;

    public boolean hasModified(AbstractVersionModel abstractVersionModel) {
        return FieldUtils.hasModified(this, abstractVersionModel, "version", "serialVersionUID");
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }
}
